<template>  
	 <web-view :src="webViewUrl" @message="onMessage" @onPostMessage="onMessage" class="boxWrapper"></web-view>
</template>

<script> 
import store from "@/store";
import {H5_URL} from '@/config/app';
import {
	toLogin,
	checkLogin
} from '@/libs/login';
export default {
	data() {
		return { 
			webViewUrl:''
		}
	},
	onLoad(options) {
		if (!store.state.app.token && !checkLogin()) {
			toLogin();
			return false;
		}
		//小程序向H5传参带在url后面
		this.webViewUrl = H5_URL + '/#/pages/manage?id='+options.id+'&token='+store.state.app.token
		
	},
	methods:{
		onMessage(e){//接收回调参数
		console.log('data1',e);
	
		}
	},
} 
</script>

<style scoped>
	/* 覆盖整个页面背景 */
	.boxWrapper {
	  background-color: #151515 !important;
	  height: 100vh;
	}
 
</style>
<style>
	page{
		 background-color: #151515!important;
		 min-height: 100vh;
	}
</style>